<!--{template admin/tpl/header}-->

<div class="mainarea">
<div class="maininner">

<div class="tabs_header">
	<ul class="tabs">
		<li$actives[all]><a href="admincp.php?ac=$ac"><span>{lang events_all_list}</span></a></li>
		<li$actives[grade0]><a href="admincp.php?ac=$ac&perpage=20&grade=0&searchsubmit=1"><span>{lang events_pending}</span></a></li>
		<li$actives[grade_1]><a href="admincp.php?ac=$ac&perpage=20&grade=-1&searchsubmit=1"><span>{lang events_not_approved}</span></a></li>
		<li$actives[grade1]><a href="admincp.php?ac=$ac&perpage=20&grade=1&searchsubmit=1"><span>{lang events_approved}</span></a></li>
		<li$actives[grade_2]><a href="admincp.php?ac=$ac&perpage=20&grade=-2&searchsubmit=1"><span>{lang events_closed}</span></a></li>
		<li$actives[grade2]><a href="admincp.php?ac=$ac&perpage=20&grade=2&searchsubmit=1"><span>{lang events_recommended}</span></a></li>
	</ul>
</div>

	<form method="get" action="admincp.php">
	<div class="block style4">
		<table cellspacing="3" cellpadding="3">
		<tr>
			<th>{lang event_id}</th><td><input type="text" name="eventid" value="$_GET[eventid]"></td>
			<th>{lang starter_id}</th><td><input type="text" name="uid" value="$_GET[uid]"></td>
		</tr>
		<tr>
			<th>{lang title} *</th><td><input type="text" name="title" value="$_GET[title]"></td>
			<th>{lang event_type}</th>
			<td>
				<select name="classid">
					<option value="">
						{lang event_type_select}
					</option>
					<!--{loop $_SGLOBAL[eventclass] $key $value}-->
					<option value="$key" <!--{if $_GET[classid] == $key}--> selected<!--{/if}-->>$value[classname]</option>
					<!--{/loop}-->
				</select>
			</td>
		</tr>
		<tr>
			<th>{lang event_location_city}</th>
			<td id="citybox">
				<script type="text/javascript" src="source/script_city.js" charset="$_SC[charset]"></script>
                <script type="text/javascript" charset="$_SC[charset]">
			showprovince('province', 'city', '$_GET[province]', 'citybox');
			showcity('city', '$_GET[city]', 'province', 'citybox');
                </script>
			</td>
			<th>{lang visibility}</th>
			<td>
				<select name="public">
					<option value="">{lang unlimited}</option>
					<option value="0"<!--{if $_GET[public] === '0'}--> selected<!--{/if}-->>{lang private}</option>
					<option value="1"<!--{if $_GET[public] === '1'}--> selected<!--{/if}-->>{lang semi_public}</option>
					<option value="2"<!--{if $_GET[public] === '2'}--> selected<!--{/if}-->>{lang full_puplic}</option>
				</select>
			</td>
		</tr>
		<tr>
			<th>{lang event_time}</th>
			<td>
				<script type="text/javascript" src="source/script_calendar.js"></script>
				<input type="text" name="starttime" value="$_GET[starttime]" onclick="showcalendar(event,this,1)"/> ~
				<input type="text" name="endtime" value="$_GET[endtime]"  onclick="showcalendar(event,this,1)" />
			</td>
			<th>{lang overtime_status}</th>
			<td>
				<select name="over">
					<option value="">{lang unlimited}</option>
					<option value="0"<!--{if $_GET[over] === '0'}--> selected<!--{/if}-->>{lang not_closed}</option>
					<option value="1"<!--{if $_GET[over] === '1'}--> selected<!--{/if}-->>{lang closed}</option>
				</select>
			</td>
		</tr>
		<tr>
			<th>{lang activity_status}</th>
			<td colspan="3">
				<select name="grade">
					<option value="">{lang unlimited}</option>
					<option value="-2"<!--{if $_GET[grade] === '-2'}--> selected<!--{/if}-->>{lang finished_allready}</option>
					<option value="-1"<!--{if $_GET[grade] === '-1'}--> selected<!--{/if}-->>{lang not_approved}</option>
					<option value="0"<!--{if $_GET[grade] === '0'}--> selected<!--{/if}-->>{lang pending}</option>
					<option value="1"<!--{if $_GET[grade] === '1'}--> selected<!--{/if}-->>{lang approved}</option>
					<option value="2"<!--{if $_GET[grade] === '2'}--> selected<!--{/if}-->>{lang recommended}</option>
				</select>
			</td>
		</tr>
		<tr><th>{lang hot_edit}</th><td colspan="3">
			<input type="text" name="hot1" value="$_GET[hot1]" size="10"> ~
			<input type="text" name="hot2" value="$_GET[hot2]" size="10">
		</td></tr>
		<tr>
			<th>{lang sort_results}</th>
			<td colspan="3">
				<select name="orderby">
					<option value="">{lang sort_default}</option>
					<option value="dateline"$orderby[dateline]>{lang publish_time}</option>
					<option value="starttime"$orderby[starttime]>{lang start_time}</option>
					<option value="membernum"$orderby[membernum]>{lang participants_num}</option>
					<option value="hot"$orderby[hot]>{lang hot_edit}</option>
				</select>
				<select name="ordersc">
					<option value="desc"$ordersc[desc]>{lang descending}</option>
					<option value="asc"$ordersc[asc]>{lang ascending}</option>
				</select>
				<select name="perpage">
					<option value="20"$perpages[20]>{lang per_page_20}</option>
					<option value="50"$perpages[50]>{lang per_page_50}</option>
					<option value="100"$perpages[100]>{lang per_page_100}</option>
					<option value="1000"$perpages[1000]>{lang per_page_1000}</option>
				</select>
				<input type="hidden" name="ac" value="event">
				<input type="submit" name="searchsubmit" value="{lang search_submit}" class="submit">
			</td>
		</tr>
		</table>
	</div>
	</form>

<!--{if $list}-->

	<form method="post" action="admincp.php?ac=event">
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	<div class="bdrcontent">

	<!--{if $perpage>100}-->
		<p>{lang total_data_by_conditions} <strong>$count</strong> {lang units}</p>
		<!--{loop $list $value}-->
		<input type="hidden" name="ids[]" value="$value[eventid]">
		<!--{/loop}-->

	<!--{else}-->
		<table cellspacing="0" cellpadding="0" class="formtable">
		<tr>
			<td width="25">&nbsp;</td>
			<th>{lang event_name}</th>
			<th width="80">{lang event_location_city}</th>
			<th width="120">{lang event_time}</th>
			<th width="80">{lang participated_interested}</th>
			<th width="80">{lang starter}</th>
			<th width="40">{lang operation}</th>
		</tr>
		<!--{loop $list $value}-->
		<tr>
			<td>
				<input type="<!--{if $allowbatch}-->checkbox<!--{else}-->radio<!--{/if}-->" name="ids[]" value="$value[eventid]">
			</td>
			<td>
				<a href="space.php?do=event&id=$value[eventid]" target="_blank">$value[title]</a>
				<a class="gray" href="admincp.php?ac=event&grade=$value[grade]">
					<!--{if $value[grade] == 0}-->{lang pending}
					<!--{elseif $value[grade]==-1}-->{lang not_approved}
					<!--{elseif $value[grade]==2}-->{lang recommended}
					<!--{elseif $value[grade]==-2}-->{lang finished_allready}
					<!--{/if}-->				
				</a>
				<!--{if $value[hot]}--><span style="color:red;">{lang hot_edit} ($value[hot])</span><!--{/if}-->
			</td>
			<td>
				<a href="admincp.php?ac=event&province=$value[province]">$value[province]</a> - 
				<a href="admincp.php?ac=event&province=$value[province]&city=$value[city]">$value[city]</a>
			</td>
			<td><!--{eval echo sgmdate('m-d',$value[starttime])}--> ~ <!--{eval echo sgmdate('m-d',$value[endtime])}--></td>
			<td>$value[membernum] / $value[follownum]</td>
			<td>
				<a href="space.php?uid=$value[uid]">$value[username]</a>
			</td>
			<td>
				<a href="cp.php?ac=event&op=edit&id=$value[eventid]" target="_blank">{lang edit}</a>
			</td>
		</tr>
		<!--{/loop}-->
		</table>
	<!--{/if}-->
	</div>

	<div class="footactions">
		<input type="hidden" name="mpurl" value="$mpurl">
		<!--{if $allowbatch && $perpage<=100}-->
		<input type="checkbox" id="chkall" name="chkall" onclick="checkAll(this.form, 'ids')">{lang check_all}
		<!--{/if}-->
		<input id="ckdelete" type="radio" name="optype" value="delete"><label for="ckdelete">{lang delete}</label>
		<input id="ckverify" type="radio" name="optype" value="verify"><label for="ckverify">{lang approved}</label>
		<input id="ckdelayverify" type="radio" name="optype" value="delayverify"><label for="ckdelayverify">{lang not_approve}</label>
		<input id="ckrecommend" type="radio" name="optype" value="recommend"><label for="ckrecommend">{lang recommended}</label>
		<input id="ckunrecommend" type="radio" name="optype" value="unrecommend"><label for="ckunrecommend">{lang un_recommend}</label>
		<input type="submit" name="opsubmit" value="{lang action_perform}" onclick="if($('ckdelete').checked){return confirm('{lang action_confirm}')};" class="submit">

		<div class="pages">$multi</div>
	</div>
	</form>
<!--{else}-->
	<div class="bdrcontent">
		<p>{lang no_data_by_conditions}</p>
	</div>
<!--{/if}-->
</div>
</div>

<div class="side">
	<!--{template admin/tpl/side}-->
</div>

<!--{template admin/tpl/footer}-->